// import React from 'react'
import './index.less'
import { Rate } from 'antd';
import { withRouter } from 'react-router-dom'

 class movieItem extends React.Component {
  render() {
    return (
      <div className="box" onClick={this.onDetail}>
        <img src={this.props.images.small} />
        <h5>电影名称：{this.props.title}</h5>
        <h5>上映年份：{this.props.year}年</h5>
        <h5>电影类型：{this.props.genres.join(', ')}</h5>
        <Rate disabled defaultValue={this.props.rating.average / 2} />
      </div>
    )
  }

  onDetail = () => {
    // this.props.history.push('/movie/detail/' + this.props.title+'/'+this.props.id)
  }
}
export default withRouter(movieItem)